<!DOCTYPE html>
<html>
<head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
    <script type="text/javascript" src="jquery.js">
    </script>
    <script src="1.js">
    </script>
</head>
<body>
<div class="main">
    <div class="inwrap">
        <h1>QRCode 生成二维码
        </h1>
        <h2>API 接口
        </h2>
        <div class="example">
            <h3>makeCode(value)
            </h3>
            <div class="form">
                <dl class="row">
                    <dt>输入内容
                    </dt>
                    <dd>
                        <input type="text" id="qrcode_text" class="input" size="30">
                    </dd>
                </dl>
                <dl class="row">
                    <dt>预览
                    </dt>
                    <dd>
                        <div id="qrcode">
                        </div>
                    </dd>
                </dl>
            </div>
        </div>
        <button id="qCode">生产二维码</button>
    </div>
</div>
<script>
    (function() {
            var qrcode = new QRCode('qrcode');
            // $('#qrcode_text').on('change', function() {
            //         qrcode.makeCode(this.value);
            //     }
            // );

            $("#qCode").click(function(){
                qrcode.makeCode($("#qrcode_text").val());
            })
        }
    )();
</script>
</body>
</html>
